home *** CD-ROM | disk | FTP | other *** search
/ Ham Radio 2000 #2 / Ham Radio 2000 - Volume 2.iso / HAMV2 / MISC / HCAL-27 / SATORBIT.BAS (.txt) < prev    next >
Encoding:
GW-BASIC  |  1997-01-29  |  4.2 KB  |  142 lines

  1. 10  'SATORBIT - satellite orbit - 14 MAR 95 rev. 28 SEP 96
  2. 20  IF EX$=""THEN EX$="EXIT"
  3. 30  CLS:KEY OFF
  4. 40  COLOR 7,0,1
  5. 50  PI=3.14159
  6. 60  RE=3963.34       'radius of earth
  7. 70  SL=186*10^3      'speed of light (miles per second)
  8. 80  E$=STRING$(80,32)
  9. 90  UL$=STRING$(80,205)
  10. 100  U1$="###,###"
  11. 110  U2$="###,###.####"
  12. 120  U3$="###,###.###"
  13. 130  U4$="###,###.##"
  14. 140  '
  15. 150  'start
  16. 160  CLS
  17. 170  COLOR 15,2
  18. 180  PRINT " SATELLITE ORBIT PARAMETERS";TAB(57);"by George Murphy VE3ERP ";
  19. 190  COLOR 1,0:PRINT STRING$(80,223);
  20. 200  COLOR 7,0
  21. 210  GOTO 270
  22. 220  '
  23. 230  '.....erase previous line
  24. 240  LOCATE CSRLIN-1:PRINT E$;:LOCATE CSRLIN-1
  25. 250  RETURN
  26. 260  '
  27. 270  '.....time and altitude
  28. 280  DIM B(20,3)
  29. 290  N=20             'number of plots
  30. 300  INC=100          'increment between plots
  31. 310  HI=144           'ref.from graph
  32. 320  LO=88            'ref.from graph
  33. 330  Y=(HI/LO)^(1/16) 'HI & LO 1600 miles apart on 100 mi.increment graph
  34. 340  '
  35. 350  FOR Z=1 TO N
  36. 360  B(Z,1)=RE+INC*Z
  37. 370  B(Z,2)=(LO/Y)*Y^Z
  38. 380  B(Z,3)=B(Z,1)/B(Z,2)
  39. 390  NEXT Z
  40. 400  '
  41. 410  PRINT " Press number in < > to choose standard units of measure:"
  42. 420  PRINT UL$;
  43. 430  PRINT "   < 1 >  Metric"
  44. 440  PRINT "   < 2 >  U.S.A./Imperial"
  45. 450  PRINT UL$;
  46. 460  PRINT "     or Press < 0 > to EXIT....."
  47. 470  Z$=INKEY$:IF Z$=""THEN 470
  48. 480  IF Z$="0"THEN CLS:RUN EX$
  49. 490  IF Z$="1"THEN UM=1.60934:UM$="Km.":GOTO 520
  50. 500  IF Z$="2"THEN UM=1:UM$="miles":GOTO 520
  51. 510  GOTO 470
  52. 520  PRINT UL$;
  53. 530  INPUT " ENTER: Period (time for single orbit) (87-157 min.) ";MIN
  54. 540  IF MIN<87 OR MIN>157 THEN GOSUB 230:GOTO 530
  55. 550  VIEW PRINT 3 TO 24:CLS:VIEW PRINT:LOCATE 3
  56. 560  FOR Z=1 TO N
  57. 570  IF MIN<B(Z,2)THEN 590
  58. 580  NEXT Z
  59. 590  J1=MIN-B(Z-1,2)
  60. 600  J2=B(Z,2)-B(Z-1,2)
  61. 610  J3=J1/J2
  62. 620  J4=B(Z-1,3)-B(Z,3)
  63. 630  J5=J3*J4
  64. 640  J6=B(Z-1,3)-J5
  65. 650  H=(J6*MIN)-RE
  66. 660  '
  67. 670  LOCATE 3
  68. 680  PRINT "        Satellite altitude...........................";
  69. 690  PRINT USING U1$;H*UM;:PRINT " ";UM$
  70. 700  C=2*RE*PI    'circumference of earth at equator (statute miles)
  71. 710  X=RE/(RE+H)                   'hypotenuse of triangle
  72. 720  ACS=ATN(X/SQR(-X*X+1))+PI/2   'inverse cosine of X
  73. 730  IF ACS>PI/2 THEN ACS=PI-ACS
  74. 740  MR=ACS/(2*PI)*C               'map range in miles
  75. 750  PRINT "        Satellite signal map range (radio horizon)...";
  76. 760  PRINT USING U1$;MR*UM;:PRINT " ";UM$
  77. 770  CA=2*(90-(ACS*180/PI))
  78. 780  PRINT "        Apex angle of satellite signal cone..........";USING U1$;CA;
  79. 790  PRINT "<UNK! {00F8}>"
  80. 800  MD=2*MR                       'map coverage circle diameter
  81. 810  PRINT "        Diameter of area covered by signal cone......";
  82. 820  PRINT USING U1$;MD*UM;:PRINT " ";UM$
  83. 830  PRINT "        Period (time for single orbit)...............";USING U1$;MIN;
  84. 840  PRINT " minutes"
  85. 850  OC=2*(RE+H)*PI   'orbit circumference (miles)
  86. 860  OM=OC/MIN        'orbital miles per minute
  87. 870  OH=OM*60         'miles per hour
  88. 880  PRINT "        Satellite orbital speed......................";
  89. 890  PRINT USING U1$;OH*UM;:PRINT " ";UM$;" per hour"
  90. 900  MPM=OM/60*5280*12*25.4/1000    'metres per second
  91. 910  IF UM=1 THEN M=0.3048:M$=" feet "ELSE M=1:M$=" metres "
  92. 920  PRINT "                                                    =";
  93. 930  PRINT USING U1$;MPM/M;:PRINT M$;"per sec."
  94. 940  SIG=2*H/SL       'signal time
  95. 950  PRINT "        Up-and-Back signal time .....................";USING U2$;SIG;
  96. 960  PRINT " sec."
  97. 970  INPUT " ENTER: UPLINK frequency (MHz).......................";UF
  98. 980  GOSUB 230
  99. 990  PRINT "        UPLINK frequency.............................";USING U3$;UF;
  100. 1000  PRINT " MHz"
  101. 1010  INPUT " ENTER: DOWNLINK frequency (MHz).....................";DF
  102. 1020  GOSUB 230
  103. 1030  PRINT "        DOWNLINK frequency...........................";USING U3$;DF;
  104. 1040  PRINT " MHz"
  105. 1050  DIF=ABS(UF-DF)
  106. 1060  DS=DIF/20
  107. 1070  PRINT "        Approximate maximum Doppler shift............";USING U1$;DS;
  108. 1080  PRINT " KHz"
  109. 1090  PRINT UL$;
  110. 1100  GOSUB 1150
  111. 1110  GOSUB 1290
  112. 1120  ERASE B:GOTO 150   'start
  113. 1130  END
  114. 1140  '
  115. 1150  '.....notes
  116. 1160  TB=9
  117. 1170  PRINT TAB(TB);
  118. 1180  PRINT "The calculations used in this program were interpolated from"
  119. 1190  PRINT TAB(TB);
  120. 1200  PRINT "graphs appearing on page 111 of the Electronics Data Book"
  121. 1210  PRINT TAB(TB);
  122. 1220  PRINT "publication No. 27 of the ARRL. The results of these calculations"
  123. 1230  PRINT TAB(TB);
  124. 1240  PRINT "are sufficiently accurate for fast reference purposes but may not"
  125. 1250  PRINT TAB(TB);
  126. 1260  PRINT "be suitable for very accurate satellite tracking."
  127. 1270  RETURN
  128. 1280  '
  129. 1290  'HARDCOPY
  130. 1300  GOSUB 1410:LOCATE 25,2:COLOR 14,6
  131. 1310  PRINT " Press 1 to print screen, 2 to print screen & ";
  132. 1320  PRINT "advance paper, or 3 to continue.";:COLOR 7,0
  133. 1330  Z$=INKEY$:IF Z$="3"THEN GOSUB 1410:RETURN
  134. 1340  IF Z$="1"OR Z$="2"THEN GOSUB 1410:GOTO 1360
  135. 1350  GOTO 1330
  136. 1360  FOR QX=1 TO 24:FOR QY=1 TO 80
  137. 1370  LPRINT CHR$(SCREEN(QX,QY));
  138. 1380  NEXT QY:NEXT QX
  139. 1390  IF Z$="2"THEN LPRINT CHR$(12)
  140. 1400  GOTO 1300
  141. 1410  LOCATE 25,1:PRINT STRING$(80,32);:RETURN
  142.